﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace 视频设备
{
    public partial class 练习 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            using (Model1Container db = new Model1Container())
            {
                设备主人 sh = new 设备主人();
                sh.序列号 = TextBox1.Text;
                db.设备主人集.AddObject(sh);
                db.SaveChanges();
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            using (Model1Container db = new Model1Container())
            {
                观众账号 sh = new 观众账号();
                sh.用户名 = TextBox2.Text;
                sh.密码 = TextBox3.Text;
                sh.权限 = TextBox4.Text;
                sh.姓名 = TextBox5.Text;
                sh.备注 = TextBox6.Text;
                sh.问题 = TextBox7.Text;
                sh.答案 = TextBox8.Text;
                db.观众账号集.AddObject(sh);
                db.SaveChanges();
            }
        }
    }
}